<template>
  <div class="check-box-button">
    <div class="imgDiv" :class="{active: isChecked}" @click="changCheck">
      <img src="~@/assets/img/cart/tick.svg" alt="">
    </div>
    <div class="check-text">
      <slot></slot>
    </div>
  </div>
</template>

<script>
export default {
  name: "CheckBoxButton",
  props: {
    isChecked: {
      type: Boolean,
      default: false
    },
  },
  methods: {
    changCheck() {
      this.$emit("changCheck");
    }
  }
}
</script>

<style scoped>
.check-box-button {
  display: flex;
  align-items: center;
}

.check-box-button .imgDiv {
  width: 20px;
  border-radius: 50%;
  border: 1px solid #999;
  text-align: center;
  margin-right: 5px;
}

.check-box-button .active {
  border-color: var(--color-tint);
  background-color: var(--color-tint);
}

.check-box-button .imgDiv img {
  vertical-align: middle;
}
</style>